package org.bjdp.katas.usewiremockforintegrationtesting;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
public class UsewiremockforintegrationtestingApplication {

	public static void main(String[] args) {
		SpringApplication.run(UsewiremockforintegrationtestingApplication.class, args);
	}

}

@Configuration
class MyConfig {
	@Bean RestTemplate restTemplate() {
		return new RestTemplate();
	}

	@Bean PersonClient personClient() {
		return new HttpPersonClient(restTemplate());
	}

	@Bean PersonService personService() {
		return new PersonService(personClient());
	}
}